package com.example.designPattern.prototype.deepclone;

public class Client {
    public static void main(String[] args) {
        DeepPrototype deepPrototype = new DeepPrototype();
        deepPrototype.name = "曹操";
        deepPrototype.deepCloneableTarget = new DeepCloneableTarget("典韦","DianWei className");
//
//        DeepPrototype clone = (DeepPrototype) deepPrototype.clone();
//
//        System.out.println(clone.name);
//        System.out.println(deepPrototype.name);
//        System.out.println(clone == deepPrototype);

        DeepPrototype o = (DeepPrototype) deepPrototype.deepClone();
        DeepPrototype o1 = (DeepPrototype) deepPrototype.deepClone();
        DeepPrototype o2 = (DeepPrototype) deepPrototype.deepClone();

        System.out.println(o.name + o.deepCloneableTarget.hashCode());
        System.out.println(o1.name + o1.deepCloneableTarget.hashCode());
        System.out.println(o2.name + o2.deepCloneableTarget.hashCode());

    }
}
